import { request, requestData } from "../Promise.js";
//请求验证码接口
export const getVerificationCode = (data) => {
  return request({
    url: "/app/auth/captcha",
    method: "get",
    data,
  });
};
//发送手机号验证
export const sendPhoneCode = (data) => {
  return request({
    url: "/app/sms/sendCode",
    method: "post",
    data,
  });
};
//获取登录接口
export const login = (data, captchaCode, captchaKey) => {
  const header = {
    ...data.headers, // 合并传入的 headers
    "Captcha-Code": captchaCode,
    "Captcha-Key": captchaKey,
  };
  return request({
    url: "/app/auth/login",
    method: "post",
    data,
    header,
  });
};
//退出登录
export const logout = (data) => {
  return request({
    url: "/app/auth/logout",
    method: "get",
    data,
  });
};
//刷新token
export const refreshToken = (data) => {
  return request({
    url: "/app/auth/refreshToken",
    method: "post",
    data,
  });
};
//企业注册
export const registerEnt = (data) => {
  return request({
    url: "/app/register/ent",
    method: "post",
    data,
  });
};
//个人注册
export const registerPerson = (data) => {
  return request({
    url: "/app/register/person",
    method: "post",
    data,
  });
};
//经营业户模糊查询
export const fuzzyOwner = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/fuzzyOwner",
    method: "post",
    data,
  });
};

//经营业户查询
export const ownerInfo = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/ownerInfo",
    method: "post",
    data,
  });
};

//从业人员信息查询
export const personInfo = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/personInfo",
    method: "post",
    data,
  });
};

//营运车辆信息查询
export const vehicleInfo = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/vehicleInfo",
    method: "post",
    data,
  });
};

//罐车罐体信息查询
export const tankInfo = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/tankInfo",
    method: "post",
    data,
  });
};

//罐式箱体信息查询
export const queryTankContainer = (data) => {
  return request({
    url: "/data-multiterminal/hg-app/qualificationInfoController/queryTankContainer",
    method: "post",
    data,
  });
};

//码表
export const maCode = (data) => {
  return request({
    url: "/blade-system/dict/dictionary?code=" + data,
    method: "get",
    // data
  });
};

//码表
export const zskUrl = (data) => {
  return request({
    url: "/data-knowledgebase/knowregulatstandards/detail/" + data,
    method: "get",
    // data
  });
};

//知识库查询
export const knowDgoodsQuery = (data) => {
  return request({
    url: "/data-knowledgebase/knowDgoods/pageApproved",
    method: "get",
    data,
  });
};

//知识库详情
export const knowDgoodsDetail = (data) => {
  console.log(data.id, "id");
  return request({
    url: "/data-knowledgebase/knowDgoods/detail/" + data.id,
    method: "get",
    // data
  });
};

//知识库-政策法规
export const knowregulatstandards = (data) => {
  return request({
    url: "/data-knowledgebase/knowregulatstandards/pageAudit",
    method: "get",
    data,
  });
};

//预警信息查询\信息列表
export const warningMsgQuery = (data) => {
  return request({
    url: "/data-inspection-study/hg-app/insp-early-warning/page",
    method: "post",
    data,
  });
};

//预警信息饼图
export const pieCharts = (data) => {
  return request({
    url: "/data-inspection-study/hg-app/insp-early-warning/statistics/pieCharts/byCategory",
    method: "post",
    data,
  });
};

//预警信息详情
export const jyxkzYq = (data) => {
  return request({
    url: "/data-inspection-study/hg-app/insp-warning-detail/page",
    method: "post",
    data,
  });
};

//企业安全评估列表
export const ownerListPg = (data) => {
  return request({
    url: "/data-assessment/hg-app/assResult/firm/page",
    method: "post",
    data,
  });
};

//企业安全评估城市列表
export const assResultDetail = (data) => {
  return request({
    url: "/data-assessment/hg-app/assResultDetail/firm/page",
    method: "post",
    data,
  });
};

//企业安全评估当前周期
export const archiveItem = (data) => {
  return request({
    url: "/data-assessment/hg-app/assEvalArchive/firm/archiveItem",
    method: "post",
    data,
  });
};

//企业历史周期
export const firmHistoryPage = (data) => {
  return request({
    url: "/data-assessment/hg-app/assResultDetail/firm/history/page",
    method: "post",
    data,
  });
};

//企业积分规则
export const assIndicatorItem = (data) => {
  return request({
    url: "/data-assessment/hg-app/assIndicatorItem/firm/list",
    method: "post",
    data,
  });
};

//从业人员评估
export const cypgList = (data) => {
  return request({
    url: "/data-assessment/hg-app/assResult/staff/page",
    method: "post",
    data,
  });
};

//从业人员评估
export const persionCity = (data) => {
  return request({
    url: "/data-assessment/hg-app/assResultDetail/staff/page",
    method: "post",
    data,
  });
};

export const cycle_persion = (data) => {
  return request({
    // url: '/data-assessment/hg-app/assEvalArchive/staff/archiveItem',
    url: "/data-assessment/hg-app/assEvalArchive/staff/archiveItem/3",
    method: "post",
    data,
  });
};
export const cycle_persion_detail = (data) => {
  return request({
    url: "/data-assessment/hg-app/assEvalArchive/staff/archiveItem/detailList",
    method: "post",
    data,
  });
};

// 历史周期
export const historyList = (data) => {
  return request({
    url: "/data-assessment/hg-app/assEvalArchive/staff/archiveItem/before",
    method: "post",
    data,
  });
};

//从业人员积分规则
export const persion_jf = (data) => {
  return request({
    url: "/data-assessment/hg-app/assIndicatorItem/staff/list",
    method: "post",
    data,
  });
};

// 安全码等级配置
export const staffLevel = (type) => {
  return request({
    url: "/data-assessment/hg-app/assEvalLevel/queryEvalScoreList/" + type,
    method: "post",
  });
};

export const staffList = (data) => {
  return request({
    url: "/data-multiterminal/safetycode/apply",
    method: "post",
    data,
  });
};

// 字典
export const getDetail = (code) => {
  return request({
    url: "/blade-system/dict/dictionary?code=" + code,
    method: "get",
  });
};

// 行政区划
export const getAdministrative = (code) => {
  return request({
    url: "/blade-system/region/detail?code=" + code,
    method: "get",
  });
};

export const getFirml = (data) => {
  return request({
    url: "/data-multiterminal/safetycode/corp/archiveInfo",
    method: "post",
    data,
  });
};

// 查询一般超速/疲劳驾驶轨迹佐证信息：基本信息
export const queryTraceDetail = (params) => {
  return request({
    url: `/data-assessment/assEvalArchive/staff/archiveItem/queryTraceDetail`,
    method: "post",
    data: params,
  });
};
// 查询一般超速/疲劳驾驶轨迹佐证信息：曲线图
export const queryGpsDatetime = (params) => {
  return request({
    url: `/data-assessment/assEvalArchive/staff/archiveItem/queryGpsDatetime`,
    method: "post",
    data: params,
  });
};

// 查询：列表：今日风险预警信息
export const warningPage = (data) => {
  return request({
    url: "/data-inspection-study/insp_early_warning/real_time_warning",
    method: "post",
    // allowMore: true,
    data,
  });
};

// 步骤
export const mgntvehrunlogList = (data) => {
  return request({
    url: "/qy-server/mgntvehrunlog/list?taskId=" + data,
    method: "get",
    data,
  });
};

export const trackQueryByBill = (data) => {
  return request({
    url: "/data-dispatch/track/queryByBill?taskId=" + data,
    method: "get",
    data,
  });
};

// 企业查询
export const queryOwnerName = (data) => {
  return request({
    url: "/qy-server/baseowner/listByLikeName",
    method: "get",
    data,
  });
};
